package Air_war;

import java.awt.image.BufferedImage;
//小敌机类
public class Airplane extends FlyingObject implements EnemyScore{

    private int  speed;//移动
    public Airplane(){
        super(48,50);
        speed = 2;
    }
    //重写step 移动
    public void step(){
        y+=speed;//y（向下
    }

    int index = 1;
    public BufferedImage getImage() {
        if(isLive()) {
            return Images.airs[0]; //ֱ返回第1张图片
        }else if(isDead()) {
            BufferedImage img = Images.airs[index++];
            if(index==Images.airs.length) {
                state = REMOVE;
            }
            return img; //返回爆破图
        }
        return null;
    }
    public int getScore(){return 1;}//打死小敌机得一分

}
